import Vue from "vue";
import App from "./App.vue";
import VueRouter from "vue-router";
import HmDenglu from "./views/denglu.vue";
import HmZhuce from "./views/zhuce.vue";
import HmHome from "./views/home.vue";
//home下4小路由
import HmArticle from "@/views/Article.vue";
import HmCollect from "@/views/Collect.vue";
import HmLike from "@/views/Like.vue";
import HmUser from "@/views/User.vue";

//Article下2小路由
import HmRecommend from "@/views/recommend.vue";
import HmNew from "@/views/new.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    { path: "/", redirect: "/denglu" },
    { path: "/denglu", component: HmDenglu },
    { path: "/zhuce", component: HmZhuce },
    {
      path: "/home/article",
      component: HmHome,
      children: [
        {
          path: "/home/article",
          component: HmArticle,
          children: [
            { path: "/home/article/", redirect: "/home/article/recommend" },
            { path: "/home/article/recommend", component: HmRecommend },
            { path: "/home/article/new", component: HmNew },
          ],
        },
        { path: "/home/collect", component: HmCollect },
        { path: "/home/like", component: HmLike },
        { path: "/home/user", component: HmUser },
      ],
    },
  ],
});

Vue.config.productionTip = false;

new Vue({
  render: (h) => h(App),
  router,
}).$mount("#app");
